package com.weilai.dao;

import com.weilai.domain.Likes;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface LikesDao {

    //根据用户id查询点赞的文章...
    @Select("SELECT * FROM likes where user_id=#{userId}")
    public List<Likes> getLikesByUserId(int userId);

    // 按 userid 删除点赞信息
    @Delete("DELETE FROM likes WHERE user_id = #{userId}")
    void deleteUserById(int userId);
}
